<div ng-controller="z-user-c" z-loading is-loading="viewModel.isLoading">
	<div viewstack class="carousel slide" data-ride="carousel">
		<div class="carousel-inner" role="listbox">
			<div class="item active">
				<div class="container-fluid">
				<form>
					<div class="row search-range">
						<div class="col-xs-10 col-sm-10 col-md-11 form-box">
							<div class="col-sm-8 col-md-8">
								<div class="col-sm-2 col-md-2 form-title">用户名：</div>
								<div class="col-sm-3 col-md-3 form-input">
									<input type="text" class="form-control"
										ng-model="viewModel.userName"/>
								</div>
							</div>
						</div>
						<div class="col-xs-2 col-sm-2 col-md-1 form-box">
							<button type="button" class="right-Btn btn btn-outline btn-info"
									ng-click="viewModel.currentPage=1;viewModel.bindData()">搜索</button>
						</div>
					</div>
				</form>
				<div class="row">
					<div class="form-box col-md-12">
						<button class="left-Btn btn btn-outline btn-primary" 
							data-toggle="modal"
							data-backdrop="static" 
							ng-click="viewModel.addUser()">新增</button>
					</div>
				</div>
				<div class="row">
					<table class="table table-striped  table-bordered table-hover">
						<thead>
							<tr>
								<th width="15%"><b>操作</b></th>
								<th style="text-align:left;"><b>用户名</b></th>
								<th style="text-align:left;"><b>状态</b></th>
								<th style="text-align:left;"><b>停用时间</b></th>
								<th style="text-align:left;"><b>日期</b></th>
							</tr>
						</thead>
						<tbody>
							<tr ng-repeat="user in viewModel.dataList">
								<td>
									<button data-toggle='modal' ng-disabled="user.userIsDisable==1"
										ng-click="viewModel.editUser(user)" 
										class="btn btn-primary btn-xs btn-sm">编辑</button>
									<button ng-if="user.userIsDisable==0"
										ng-click="viewModel.disableById(user)"
										class="btn btn-danger btn-xs btn-sm">停用</button>
									<button ng-if="user.userIsDisable==1"
										ng-click="viewModel.startById(user)"
										class="btn btn-success btn-xs btn-sm">启动</button>
										
								</td>
								<td style="text-align:left;">{{user.userName}}</td>
								<td ng-switch="user.userIsDisable" style="text-align:left;">
									<span ng-switch-when="0">启动</span> 
									<span ng-switch-when="1">停用</span>
								</td>
								<td style="text-align:left;">{{user.userDisableDate | date:'yyyy/MM/dd'}}</td>
								<td style="text-align:left;">{{user.updateTime | date:'yyyy/MM/dd hh:mm:ss'}}</td>
							</tr>
						</tbody>
					</table>
				</div>
				<div class="row">
					<div z-Pagination total-Data='viewModel.totalData'
						per-Page='viewModel.perPage'
						current-Page='viewModel.currentPage'
						on-Click="viewModel.bindData()"
						on-Change-Per-Page="viewModel.bindData()"></div>
				</div>
				</div>
			</div>
		</div>
	</div>
	<z-Dialog show-Save-Btn="true" 
		have-Error-Class="viewModel.checkGlobal()" 
		load-Url="static/html/user/userEdit.html" 
		title="{{editModel.title}}" 
		show="viewModel.show"
		cancel-fn="viewModel.unLoad()"
		save-fn="viewModel.save()"></z-Dialog>
</div>